1 Pre-processing

1.1 Load packages

library(Seurat)
library(Signac)
library(flexclust)
library(tidyverse)
library(plyr)
library(harmony)
library(class)
library(ggplot2)
library(reshape2)

1.2 Parameters

path_to_save_annotated_citeseq <- "/home/srashmi/Documents/tonsil_atlas_citeseq_vdj_20210505/10-sub_cluster_annotation/PC_differential/objects/PC_tonsil_cite_seq_annotated.rds"
color <- c("black", "gray", "red", "yellow", "violet", "green4",
                   "blue", "mediumorchid2", "coral2", "blueviolet",
                   "indianred4", "deepskyblue1", "dimgray", "deeppink1",
                   "greenyellow", "lightgray", "hotpink1", "chocolate", "aquamarine", "aliceblue", "burlywood", "blueviolet", "indianred", "gold","coral", "orangered")

1.3 Variables

1.4 Load data

seurat_citeseq <- readRDS(path_to_save_annotated_citeseq)
DefaultAssay(seurat_citeseq) <- "ADT"
Idents(seurat_citeseq) <- seurat_citeseq@meta.data$PC_annotation_level_5

1.5 GZ-LZ vs PC commited

markers <- FindMarkers(object = seurat_citeseq, ident.1 = "GC-LZ", ident.2 = "PC committed GC-LZ", min.pct = 0.25)
DT::datatable(markers)
DoHeatmap(seurat_citeseq, features = unique(rownames(markers)), label = F)

## $`0`

## 
## $`1`

1.6 GZ-LZ vs IgG+ PC precursor

markers <- FindMarkers(object = seurat_citeseq, ident.1 = "GC-LZ", ident.2 = "IgG+ PC precursor", min.pct = 0.25)
DT::datatable(markers)
DoHeatmap(seurat_citeseq, features = unique(rownames(markers)), label = F) 

## $`0`

## 
## $`1`

1.7 GZ-LZ vs Pre-Mature IgG+ PC

markers <- FindMarkers(object = seurat_citeseq, ident.1 = "GC-LZ", ident.2 = "Pre-Mature IgG+ PC", min.pct = 0.25)
DT::datatable(markers)
DoHeatmap(seurat_citeseq, features = unique(rownames(markers)), label = F) 

## $`0`

## 
## $`1`

## 
## $`2`

1.8 GZ-LZ vs Mature PC (“MBC-derived IgG+ PC”, “MBC-derived IgA+ PC”, “Mature IgM+ PC”, “Mature IgG+ PC”, “Mature IgA+ PC”)

markers <- FindMarkers(object = seurat_citeseq, ident.1 = "GC-LZ", ident.2 = c("MBC-derived IgG+ PC", "MBC-derived IgA+ PC", "Mature IgM+ PC", "Mature IgG+ PC", "Mature IgA+ PC"), min.pct = 0.25)
DT::datatable(markers)
DoHeatmap(seurat_citeseq, features = unique(rownames(markers)), label = F) 

## $`0`

## 
## $`1`

## 
## $`2`

## 
## $`3`

## 
## $`4`

1.9 PC committed GC-LZ vs IgG+ PC precursor

markers <- FindMarkers(object = seurat_citeseq, ident.1 = "PC committed GC-LZ", ident.2 = "IgG+ PC precursor", min.pct = 0.25)
DT::datatable(markers)
DoHeatmap(seurat_citeseq, features = unique(rownames(markers)), label = F) 

## $`0`

## 
## $`1`

1.10 PC committed GC-LZ vs Pre-Mature IgG+ PC

markers <- FindMarkers(object = seurat_citeseq, ident.1 = "PC committed GC-LZ", ident.2 = "Pre-Mature IgG+ PC", min.pct = 0.25)
DT::datatable(markers)
DoHeatmap(seurat_citeseq, features = unique(rownames(markers)), label = F) 

## $`0`

## 
## $`1`

## 
## $`2`

## 
## $`3`

1.11 PC committed GC-LZ vs Mature PC (“MBC-derived IgG+ PC”, “MBC-derived IgA+ PC”, “Mature IgM+ PC”, “Mature IgG+ PC”, “Mature IgA+ PC”)

markers <- FindMarkers(object = seurat_citeseq, ident.1 = "PC committed GC-LZ", ident.2 = c("MBC-derived IgG+ PC", "MBC-derived IgA+ PC", "Mature IgM+ PC", "Mature IgG+ PC", "Mature IgA+ PC"), min.pct = 0.25)
DT::datatable(markers)
DoHeatmap(seurat_citeseq, features = unique(rownames(markers)), label = F) 

## $`0`

## 
## $`1`

## 
## $`2`

## 
## $`3`

## 
## $`4`

## 
## $`5`

1.12 IgG+ PC precursor vs Pre-Mature IgG+ PC

markers <- FindMarkers(object = seurat_citeseq, ident.1 = "IgG+ PC precursor", ident.2 = "Pre-Mature IgG+ PC", min.pct = 0.25)
DT::datatable(markers)
DoHeatmap(seurat_citeseq, features = unique(rownames(markers)), label = F)  

## $`0`

1.13 IgG+ PC precursor vs Mature PC (“MBC-derived IgG+ PC”, “MBC-derived IgA+ PC”, “Mature IgM+ PC”, “Mature IgG+ PC”, “Mature IgA+ PC”)

markers <- FindMarkers(object = seurat_citeseq, ident.1 = "IgG+ PC precursor", ident.2 = c("MBC-derived IgG+ PC", "MBC-derived IgA+ PC", "Mature IgM+ PC", "Mature IgG+ PC", "Mature IgA+ PC"), min.pct = 0.25)
DT::datatable(markers)
DoHeatmap(seurat_citeseq, features = unique(rownames(markers)), label = F)

## $`0`

## 
## $`1`

## 
## $`2`

1.14 Pre-Mature IgG+ PC vs Mature PC (“MBC-derived IgG+ PC”, “MBC-derived IgA+ PC”, “Mature IgM+ PC”, “Mature IgG+ PC”, “Mature IgA+ PC”)

markers <- FindMarkers(object = seurat_citeseq, ident.1 = "Pre-Mature IgG+ PC", ident.2 = c("MBC-derived IgG+ PC", "MBC-derived IgA+ PC", "Mature IgM+ PC", "Mature IgG+ PC", "Mature IgA+ PC"), min.pct = 0.25)
DT::datatable(markers)
DoHeatmap(seurat_citeseq, features = unique(rownames(markers)), label = F) 

## $`0`

## 
## $`1`

2 Session Information

sessionInfo()
## R version 4.0.3 (2020-10-10)
## Platform: x86_64-pc-linux-gnu (64-bit)
## Running under: Ubuntu 20.04.2 LTS
## 
## Matrix products: default
## BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.9.0
## LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.9.0
## 
## locale:
##  [1] LC_CTYPE=en_GB.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8        LC_COLLATE=en_GB.UTF-8     LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_GB.UTF-8    LC_PAPER=en_US.UTF-8       LC_NAME=C                  LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       
## 
## attached base packages:
## [1] stats4    grid      stats     graphics  grDevices utils     datasets  methods   base     
## 
## other attached packages:
##  [1] reshape2_1.4.4     class_7.3-18       harmony_0.1.0      Rcpp_1.0.7         plyr_1.8.6         forcats_0.5.1      stringr_1.4.0      dplyr_1.0.7        purrr_0.3.4        readr_2.1.1        tidyr_1.1.4        tibble_3.1.6       ggplot2_3.3.5      tidyverse_1.3.1    flexclust_1.4-0    modeltools_0.2-23  lattice_0.20-41    Signac_1.5.0       SeuratObject_4.0.4 Seurat_4.0.5       BiocStyle_2.18.1  
## 
## loaded via a namespace (and not attached):
##   [1] SnowballC_0.7.0        scattermore_0.7        knitr_1.36             irlba_2.3.5            data.table_1.14.2      rpart_4.1-15           RCurl_1.98-1.5         generics_0.1.1         BiocGenerics_0.36.1    cowplot_1.1.1          RANN_2.6.1             future_1.23.0          tzdb_0.2.0             spatstat.data_2.1-0    xml2_1.3.3             lubridate_1.8.0        httpuv_1.6.4           assertthat_0.2.1       xfun_0.29              hms_1.1.1              jquerylib_0.1.4        evaluate_0.14          promises_1.2.0.1       fansi_0.5.0            dbplyr_2.1.1           readxl_1.3.1           igraph_1.2.6           DBI_1.1.1              htmlwidgets_1.5.4      sparsesvd_0.2          spatstat.geom_2.3-1    ellipsis_0.3.2         crosstalk_1.2.0        backports_1.4.1        bookdown_0.24          deldir_1.0-6           vctrs_0.3.8            ROCR_1.0-11            abind_1.4-5            withr_2.4.3            ggforce_0.3.3          sctransform_0.3.2.9008 goftest_1.2-3          cluster_2.1.0          lazyeval_0.2.2         crayon_1.4.2           pkgconfig_2.0.3        slam_0.1-49            labeling_0.4.2         tweenr_1.0.2           GenomeInfoDb_1.26.7   
##  [52] nlme_3.1-152           rlang_0.4.12           globals_0.14.0         lifecycle_1.0.1        miniUI_0.1.1.1         modelr_0.1.8           cellranger_1.1.0       polyclip_1.10-0        matrixStats_0.61.0     lmtest_0.9-39          Matrix_1.4-0           ggseqlogo_0.1          zoo_1.8-9              reprex_2.0.1           ggridges_0.5.3         png_0.1-7              viridisLite_0.4.0      bitops_1.0-7           KernSmooth_2.23-18     Biostrings_2.58.0      parallelly_1.29.0      S4Vectors_0.28.1       scales_1.1.1           magrittr_2.0.1         ica_1.0-2              zlibbioc_1.36.0        compiler_4.0.3         RColorBrewer_1.1-2     fitdistrplus_1.1-6     Rsamtools_2.6.0        cli_3.1.0              XVector_0.30.0         listenv_0.8.0          patchwork_1.1.1        pbapply_1.5-0          MASS_7.3-54            mgcv_1.8-33            tidyselect_1.1.1       stringi_1.7.6          highr_0.9              yaml_2.2.1             ggrepel_0.9.1          sass_0.4.0             fastmatch_1.1-3        tools_4.0.3            future.apply_1.8.1     parallel_4.0.3         rstudioapi_0.13        lsa_0.73.2             gridExtra_2.3          farver_2.1.0          
## [103] Rtsne_0.15             digest_0.6.29          BiocManager_1.30.16    shiny_1.7.1            qlcMatrix_0.9.7        GenomicRanges_1.42.0   broom_0.7.10           later_1.3.0            RcppAnnoy_0.0.19       httr_1.4.2             colorspace_2.0-2       rvest_1.0.2            fs_1.5.2               tensor_1.5             reticulate_1.22        IRanges_2.24.1         splines_4.0.3          uwot_0.1.11            RcppRoll_0.3.0         spatstat.utils_2.3-0   plotly_4.10.0          xtable_1.8-4           jsonlite_1.7.2         R6_2.5.1               pillar_1.6.4           htmltools_0.5.2        mime_0.12              glue_1.5.1             fastmap_1.1.0          DT_0.20                BiocParallel_1.24.1    codetools_0.2-18       utf8_1.2.2             bslib_0.3.1            spatstat.sparse_2.0-0  leiden_0.3.9           survival_3.2-7         limma_3.46.0           rmarkdown_2.11         docopt_0.7.1           munsell_0.5.0          GenomeInfoDbData_1.2.4 haven_2.4.3            gtable_0.3.0           spatstat.core_2.3-2